package org.aurora.five;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.concurrent.CopyOnWriteArrayList;

/**
 * @author : Aurora
 * @date : 2024/3/27 10:20
 * @description
 */
public class CopyOnWriteArrayListAnalysis {
    public static void main(String[] args) {
        CopyOnWriteArrayList<String> arr = new CopyOnWriteArrayList<String>();
        ArrayList<String> list = new ArrayList<>();
        list.iterator();
        //add、get、remove源码讲解
        arr.add("aaaa");
        arr.add("bbbb");
        Iterator<String> iterator = arr.iterator();
        arr.remove(1);
        while(iterator.hasNext()){
            System.out.println(iterator.next());
        }
    }
}
